package la.iok.hzsvn.lewin.movie.controller;

import la.iok.hzsvn.lewin.movie.core.movieservice.vo.MovieLevelVo;
import la.iok.hzsvn.lewin.movie.service.MovieLevelService;
import la.iok.hzsvn.share.response.ListDataResponse;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("internal-api/movieLevels")
public class MovieLevelInternalController {
    private final MovieLevelService movieLevelService;

    public MovieLevelInternalController(MovieLevelService movieLevelService) {
        this.movieLevelService = movieLevelService;
    }

    @GetMapping
    public ListDataResponse<MovieLevelVo> list(){
        return new ListDataResponse<>(movieLevelService.po2vo(movieLevelService.selectAll()));
    }
}
